﻿<template>
    <el-dialog title="发货明细" v-model="visible" :width="1300" destroy-on-close @closed="$emit('closed')">
        <el-form :model="entityObj" :rules="rules" :disabled="mode == 'Show'" ref="dialogForm" label-width="100px">
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="发货明细:">
                        <el-table :data="entityObj.sendOrderItems" border style="width: 100%" >
                            <el-table-column label="物料编码" width="110" prop="materialCode">
                            </el-table-column>
                            <el-table-column label="物料名称" width="140" prop="materialName">
                            </el-table-column>
                            <el-table-column label="规格" width="100" prop="materialSpecs">
                            </el-table-column>
                            <el-table-column label="物料类别" width="85" prop="materialTypeName">
                            </el-table-column>
                            <el-table-column label="单位" width="85" prop="unitName">
                            </el-table-column>
                            <el-table-column label="发货数量" width="85" prop="qty">
                            </el-table-column>
                            <el-table-column label="发货编号" width="130" prop="sendOrderCode">
                            </el-table-column>
                            <el-table-column label="发货人" width="110" prop="sendName">
                            </el-table-column>
                            <el-table-column label="发货时间" width="110" prop="sendDate">
                                <template #default="scope">{{scope.row.sendDate?.slice(0,10)}}</template>
                            </el-table-column>
                            <el-table-column label="物流详情" width="200" prop="logistics">
                                <template #default="scope">
                                    {{scope.row.logisticNsame}}{{scope.row.logisticsCode&&scope.row.logisticsCode.length >0?'('+scope.row.logisticsCode+')':"无"}}
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </el-dialog>
</template>
<script>
import tool from "@/utils/tool";
export default {
    emits: ["success", "closed"],
    data() {
        return {
            mode: "Send",
            titleMap: {
                Send: "物料发货明细",
            },
            entityObj: {
            },
            materialState: false,
            queryList: {},
            visible: false,
            isSaveing: false,
            needSaveFlag: false,
            //验证规则
            rules: {
                purchaseProtocolName: [
                    { required: true, type: "string", message: "请填写" },
                ],
                purchaseUnityName: [
                    { required: true, type: "string", message: "请填写" },
                ],
                supplier: [
                    { required: true, type: "object", message: "请填写" },
                ],
                protocolDate: [
                    { required: true, type: "array", message: "请填写" },
                ],
                crName: [{ required: true, type: "string", message: "请填写" }],
                crDate: [{ required: true, type: "string", message: "请填写" }],
                materialSpecs: [
                    { required: true, type: "string", message: "请填写" },
                ],
                purchaseProtocolItems: [
                    {
                        required: true,
                        type: "array",
                        message: "请填写",
                        trigger: "change",
                    },
                ],
            },
            props: {
                label: "supplierName",
                value: "supplierId",
            },
            materialProps: {
                label: "materialCode",
                value: "materialId",
                items: "materialItems",
            },
            materialTypeTree: [],
            optionsLogistics: [],
            itemsData: [],
        };
    },
    computed: {
    },
    methods: {
        //显示=
        open(mode = "Send") {
            this.mode = mode;
            this.visible = true;
            return this;
        },
        //表单注入数据
        async setData(data) {
            this.entityObj.sendOrderItems=data;
        },
    },
    async mounted() {
    },
};
</script>

<style scoped>
.el-form-item {
    margin-bottom: 5px !important;
}
</style>
